package com.lanxiao.cloud.common.mybatis.basic;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.lanxiao.cloud.common.core.enums.DelFlagEnum;

/**
 * @author ：qiaoliang
 * @date ：2021-08-19
 */
public class BaseEntity <T,E> extends Entity<T> {

  @TableField(fill = FieldFill.INSERT)
  private E createBy;
  @TableField(fill = FieldFill.UPDATE)
  private E updateBy;
  /** 备注 **/
  private String remark;
  /** 删除标记 **/
  @TableField(fill = FieldFill.INSERT)
  private DelFlagEnum delFlag;

  public BaseEntity() {
  }

  public BaseEntity(String remark, DelFlagEnum delFlag) {
    this.remark = remark;
    this.delFlag = delFlag;
  }

  public BaseEntity(T id, String remark, DelFlagEnum delFlag) {
    super(id);
    this.remark = remark;
    this.delFlag = delFlag;
  }

  /**
   *  假删除
   *
   * @author ：qiaoliang
   * @date 2020-10-20 10:29
   */
  public void delete(){
    this.setDelFlag(DelFlagEnum.DELETE);
  }

  public E getCreateBy() {
    return createBy;
  }

  public void setCreateBy(E createBy) {
    this.createBy = createBy;
  }

  public E getUpdateBy() {
    return updateBy;
  }

  public void setUpdateBy(E updateBy) {
    this.updateBy = updateBy;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public DelFlagEnum getDelFlag() {
    return delFlag;
  }

  public void setDelFlag(DelFlagEnum delFlag) {
    this.delFlag = delFlag;
  }


}
